<template>
  <div class="product-card">
    <t-card :title="product.name" :subtitle="product.description">
      <template #actions>
        <t-tag theme="primary">{{ product.price }}</t-tag>
      </template>
      <div class="product-stats">
        <div class="stat-item">
          <span class="stat-label">销量</span>
          <span class="stat-value">{{ product.sales }}</span>
        </div>
        <div class="stat-item">
          <span class="stat-label">库存</span>
          <span class="stat-value">{{ product.stock }}</span>
        </div>
      </div>
    </t-card>
  </div>
</template>

<script lang="ts" setup>
import type { Product } from '@/types/dashboard';

defineProps<{
  product: Product;
}>();
</script>

<style scoped>
.product-card {
  height: 100%;
}

.product-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}
</style>
